bitkeeper revision 1.1014 (40daed7e9y-gp5z9q05byc8SDgQ1Mg)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Thu, 24 Jun 2004 15:04:30 +0000 (15:04 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Thu, 24 Jun 2004 15:04:30 +0000 (15:04 +0000)
manual merge

tools/xc/lib/xc_domain.c
tools/xc/lib/xc_linux_save.c
xen/common/shadow.c
xen/include/hypervisor-ifs/dom0_ops.h

index 20a323a047650b9c508fb2badc146191e58268cb..38b3e2ee340cf1d6dfbb6e999f7c27ac7f95ebec 100644 (file)
@@ -117,6 +117,24 @@ int xc_domain_getinfo(int xc_handle,
     return nr_doms;
 }
 
+int xc_domain_getfullinfo(int xc_handle,
+                      u32 domid,
+                      dom0_op_t *op,
+                      full_execution_context_t *ctxt )
+{
+    int rc;
+    op->cmd = DOM0_GETDOMAININFO;
+    op->u.getdomaininfo.domain = (domid_t)domid;
+    op->u.getdomaininfo.ctxt = ctxt;
+
+    rc = do_dom0_op(xc_handle, op);
+    if ( ((u32)op->u.getdomaininfo.domain != domid) && rc > 0 )
+       return -ESRCH;
+    else
+       return rc;
+}
+
+
 int xc_shadow_control(int xc_handle,
                       u32 domid, 
                       unsigned int sop,
index 02f67dfc277cca4acf381b0a2ba54409e6dd7cdf..e93120a08bff7f758d04ee8f315aeae6c9c90b43 100644 (file)
@@ -319,12 +319,17 @@ int xc_linux_save(int xc_handle,
 
     /* Ensure that the domain exists, and that it is stopped. */
 
-    if ( xc_domain_pause( xc_handle, domid, &op, &ctxt ) )
+    if ( xc_domain_pause( xc_handle, domid ) )
     {
        PERROR("Could not pause domain");
        goto out;
     }
 
+    if ( xc_domain_getfullinfo( xc_handle, domid, &op, &ctxt) )
+    {
+       PERROR("Could not get full domain info");
+       goto out;
+    }
     memcpy(name, op.u.getdomaininfo.name, sizeof(name));
     shared_info_frame = op.u.getdomaininfo.shared_info_frame;
 
@@ -381,7 +386,7 @@ int xc_linux_save(int xc_handle,
            pgd[HYPERVISOR_VIRT_START>>L2_PAGETABLE_SHIFT]>>PAGE_SHIFT;
 
        live_mfn_to_pfn_table = 
-           mfn_mapper_map_single(xc_handle, ~0ULL
+           mfn_mapper_map_single(xc_handle, ~0UL, 
                                  PAGE_SIZE*1024, PROT_READ, 
                                  mfn_to_pfn_table_start_mfn );
     }
@@ -805,7 +810,7 @@ int xc_linux_save(int xc_handle,
                DPRINTF("Start last iteration\n");
                last_iter = 1;
 
-               xc_domain_pause( xc_handle, domid, &op, NULL );
+               xc_domain_pause( xc_handle, domid );
 
            } 
 
@@ -839,13 +844,9 @@ int xc_linux_save(int xc_handle,
     }
 
     /* Get the final execution context */
-    op.cmd = DOM0_GETDOMAININFO;
-    op.u.getdomaininfo.domain = (domid_t)domid;
-    op.u.getdomaininfo.ctxt = &ctxt;
-    if ( (do_dom0_op(xc_handle, &op) < 0) || 
-        ((u32)op.u.getdomaininfo.domain != domid) )
+    if ( xc_domain_getfullinfo( xc_handle, domid, &op, &ctxt) )
     {
-       PERROR("Could not get info on domain");
+       PERROR("Could not get full domain info");
        goto out;
     }
 
index 810c01b88e9a27585b5bd25fcd69405da75ac970..de5fe4b4fa7085dea2945b37dba46b2f2981cef9 100644 (file)
@@ -426,10 +426,10 @@ static int shadow_mode_table_op(struct domain *d,
     {
                int i;
 
-               sc->stats.fault_count       = p->mm.shadow_fault_count;
-               sc->stats.dirty_count       = p->mm.shadow_dirty_count;
-               sc->stats.dirty_net_count   = p->mm.shadow_dirty_net_count;
-               sc->stats.dirty_block_count = p->mm.shadow_dirty_block_count;
+               sc->stats.fault_count       = d->mm.shadow_fault_count;
+               sc->stats.dirty_count       = d->mm.shadow_dirty_count;
+               sc->stats.dirty_net_count   = d->mm.shadow_dirty_net_count;
+               sc->stats.dirty_block_count = d->mm.shadow_dirty_block_count;
        
                if( d->tot_pages > sc->pages || 
                        !sc->dirty_bitmap || !d->mm.shadow_dirty_bitmap )
index 7eb5f548dc0e63b1fb5fc03db12ff0d64c084315..9cb5656b3eaa037ae200d71d57286110e8817b75 100644 (file)
@@ -279,7 +279,7 @@ typedef struct {
     memory_t       pages;  /* 16: size of buffer, updated with actual size */
     MEMORY_PADDING;
     /* OUT variables. */
-    dom0_shadow_control_stats_t;
+    dom0_shadow_control_stats_t stats;
 } PACKED dom0_shadow_control_t;